package com.itheima.reggie.controller;

import com.itheima.reggie.common.ResultInfo;
import com.itheima.reggie.domain.Orders;
import com.itheima.reggie.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrdersController {
    @Autowired
    private OrdersService ordersService;
    //http://localhost:8081/order/submit
    @PostMapping("/order/submit")
    public ResultInfo save(@RequestBody Orders orders){
        ordersService.saveOrder(orders);
        return ResultInfo.success(null);
    }
}
